﻿using System;
using System.Linq;
using System.Linq.Expressions;
using LINQtoNHibernateMVC.Core.Domain.Model;

namespace LINQtoNHibernateMVC.Core.Domain {
	public interface IRepository {
		T Load<T>(object id) where T : Entity;
		T Get<T>(object id) where T : Entity;
		T Get<T>(Expression<Func<T, bool>> prediate) where T : Entity;

		IQueryable<T> FindAll<T>() where T : Entity;
		IQueryable<T> Find<T>(Expression<Func<T, bool>> prediate) where T : Entity;

		void Add<T>(T entity) where T : Entity;
		void Remove<T>(T entity) where T : Entity;

		void SubmitChanges();
	}
}
